function xuanze() {
    var de = document.getElementById('default');
    var declass = document.querySelector('.default');
    var ps = declass.children;
    var sales = document.getElementById('sales');
    var cselect = document.getElementById('cselect');
    var img = de.querySelector('img');
    //默认选择Tap封装
    Tap(de, function () {
        if (declass.style.opacity != 1) {
            declass.style = 'height: 157px;opacity: 1;';
            img.style.transform = 'rotate(180deg)';
            img.style.webkitTransform = 'rotate(180deg)';
        } else {
            declass.style = '';
            img.style.transform = '';
            img.style.webkitTransform = '';
        }
    });
    //END
    //默认选择中的默认排序Tap封装
    for (var i = 0; i < ps.length; i++) {
        Tap(ps[i], function (e, dom) {
            for (var o = 0; o < ps.length; o++) {
                ps[o].style.color = '';
            }
            dom.style.color = '#EF5964';
            var html = dom.innerHTML;
            declass.style = 'height: 0;opacity: 0;';
            img.style.transform = '';
            img.style.webkitTransform = '';
            de.querySelector('em').innerHTML = html;
            de.style.color = '#EF5964';
            sales.style.color = '';
            //ajax请求后台筛选数据
            ajax({
                method: 'GET',
                url: 'bb.json',
                data: {
                    req: html
                },
                success: function (response) {
                    response = JSON.parse(response);
                }
            });
            //ajaxEND
        });
    }
    //END
    //下载优先Tap封装
    Tap(sales, function (e, dom) {
        dom.style.color = '#EF5964';
        de.style.color = '';
        ajax({
            method: 'GET',
            url: 'bb.json',
            data: {
                req: '下载优先'
            },
            success: function (response) {
                response = JSON.parse(response);
            }
        });
    });
    //END
};
//点击切换
var datao = {
    o: [{}, {}, {}]
};
//AJAX模板END
window.onload = function () {
    ajax({
        method: 'GET',
        url: '',
        data: {},
        success: function (response) {
            response = JSON.parse(response);
        }
    });
    xuanze();
};